﻿using System.Collections.Specialized;

namespace ActivateYourGlutes.Data.Model
{
    public partial class Body
    {
        public NameValueCollection Validate()
        {
            var errors = new NameValueCollection();

            if (Measurements == null || Measurements.Count == 0)
            {
                errors.Add("_FORM", "You must enter at least one measurement.");
            }
            else
            {
                foreach (Measurement measurement in Measurements)
                    measurement.Validate(errors);
            }            

            return errors;
        }
    }
}
